<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *留言记录
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
if($_RQ['op']=='edit'){
	$item=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$item['cardinfo']=$item['cardinfo']?json_decode($item['cardinfo'],true):array('cardimg1'=>'');
	$item['pcd']=json_decode($item['pcd'],true);
	$return['sex']=$this->sex;
	$return['item']=$item;
	set_html('title','我的信息');
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$data=array(
		'realname'=>trim($postdata['realname']),
		'mobile'=>trim($postdata['mobile']),
		'sex'=>trim($postdata['sex']),
		'address'=>trim($postdata['address']),
		'cardinfo'=>ijson_encode($postdata['cardinfo']),
		'pcd'=>ijson_encode($postdata['pcd']),
	);
	$id=intval($postdata['id']);
	if($id){
		pdo_update('core_members',$data,array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	}else{
		$data['uniacid']=$_SESSION['uniacid'];
		pdo_insert('core_members',$data);
	}
	exi('操作成功！','','/home/');
}
